<template>
    <div class="TitleComponent">
        <div class="left">
            <img :src="props.titleData.imgUrl" alt="" />
            <div class="name">{{ props.titleData.name }}</div>
        </div>
        <div class="right">
            <div class="num">{{ props.titleData.num }}</div>
            <div class="util">{{ props.titleData.util }}</div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { getAssetsFile } from '@/utils'

const props = defineProps({
    titleData: {
        type: Object,
        default: () => {
            return {
                imgUrl: getAssetsFile('home/Frame.png'),
                name: '总负荷',
                num: '20952.63',
                util: 'w'
            }
        }
    }
})
</script>

<style scoped lang="scss">
.TitleComponent {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #a4a9ab;
    margin-bottom: 15px;
    width: 500px;
    color: #ffffff;
    .left,
    .right {
        display: flex;
        align-items: center;
    }
    .left {
        flex: 1;
        justify-content: flex-start;
        img {
            width: 30px;
            height: 30px;
        }
        .name {
            font-family: Oppo;
            font-size: 18px;
            font-weight: 400;
            line-height: 24px;
            letter-spacing: 1px;
            text-align: center;
            margin-left: 10px;
        }
    }
    .right {
        color: #009bf1;
        .num {
            font-family: PangMenZhengDao;
            font-size: 30px;
            line-height: 38px;
            letter-spacing: 1px;
            font-weight: 400;
            text-align: right;
            margin-right: 2px;
        }
        .util {
            margin-top: 8px;
            font-size: 14px;
        }
    }
}
</style>
